﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace Extensil.Processor
{
    [Serializable()]
    [XmlRoot("Extensil")]
    public class ExtensilPlugin
    {
        [XmlArray("CategoryHandlers"), XmlArrayItem(typeof(Plugin), ElementName = "CategoryHandler")]
        public List<Plugin> CategoryHandlers
        {
            get;
            set;
        }

        [XmlArray("ProbeHandlers"), XmlArrayItem(typeof(Plugin), ElementName = "ProbeHandler")]
        public List<Plugin> ProbeHandlers
        {
            get;
            set;
        }
    }
    [Serializable()]
    public class Plugin
    {
        [XmlAttribute("name")]
        public string Name
        {
            get;
            set;
        }
        [XmlAttribute("path")]
        public string Path
        {
            get;
            set;
        }
        [XmlAttribute("version")]
        public string Version
        {
            get;
            set;
        }
        [XmlAttribute("hidden")]
        public bool Hidden
        {
            get;
            set;
        }
        [XmlAttribute("autostart")]
        public bool AutoStart
        {
            get;
            set;
        }
        [XmlAttribute("hotKey")]
        public string HotKey
        {
            get;
            set;
        }
        [XmlArray("Dependants"), XmlArrayItem(typeof(IncludeFile), ElementName = "include")]
        public List<IncludeFile> Dependencies
        {
            get;
            set;
        }
        [XmlArray("appSettings"), XmlArrayItem(typeof(AddElement), ElementName = "add")]
        public List<AddElement> AppSettings
        {
            get;
            set;
        }
    }
    [Serializable()]
    public class IncludeFile
    {
        [XmlAttribute("path")]
        public string Path
        {
            get;
            set;
        }
    }
}
